<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qregion.cpp -->
  <title>QRegion Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QRegion</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#creating-and-using-regions">Creating and Using Regions</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QRegion Class</h1>
<!-- $$$QRegion-brief -->
<p>The QRegion class specifies a clip region for a painter. <a href="#details">More...</a></p>
<!-- @@@QRegion -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QRegion&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr></table></div><ul>
<li><a href="qregion-members.html">List of all members, including inherited members</a></li>
<li><a href="qregion-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#RegionType-enum">RegionType</a></b> { Rectangle, Ellipse }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#const_iterator-typedef">const_iterator</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#const_reverse_iterator-typedef">const_reverse_iterator</a></b></td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#QRegion-6">QRegion</a></b>(const QBitmap &amp;<i>bm</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#QRegion-5">QRegion</a></b>(QRegion &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#QRegion-4">QRegion</a></b>(const QRegion &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#QRegion-3">QRegion</a></b>(const QPolygon &amp;<i>a</i>, Qt::FillRule <i>fillRule</i> = Qt::OddEvenFill)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#QRegion-2">QRegion</a></b>(const QRect &amp;<i>r</i>, QRegion::RegionType <i>t</i> = Rectangle)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#QRegion-1">QRegion</a></b>(int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, QRegion::RegionType <i>t</i> = Rectangle)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#QRegion">QRegion</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-eq-1">operator=</a></b>(QRegion &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-eq">operator=</a></b>(const QRegion &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#begin">begin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#boundingRect">boundingRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#cbegin">cbegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#cend">cend</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#contains">contains</a></b>(const QPoint &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#contains-1">contains</a></b>(const QRect &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#crbegin">crbegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#crend">crend</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#end">end</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#intersected">intersected</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#intersected-1">intersected</a></b>(const QRect &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#intersects">intersects</a></b>(const QRegion &amp;<i>region</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#intersects-1">intersects</a></b>(const QRect &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#isEmpty">isEmpty</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#isNull">isNull</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#rbegin">rbegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#rectCount">rectCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#rend">rend</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#setRects">setRects</a></b>(const QRect *<i>rects</i>, int <i>number</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#subtracted">subtracted</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#swap">swap</a></b>(QRegion &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#translate">translate</a></b>(int <i>dx</i>, int <i>dy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#translate-1">translate</a></b>(const QPoint &amp;<i>point</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#translated">translated</a></b>(int <i>dx</i>, int <i>dy</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#translated-1">translated</a></b>(const QPoint &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#united">united</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#united-1">united</a></b>(const QRect &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#xored">xored</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-QVariant">operator QVariant</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-not-eq">operator!=</a></b>(const QRegion &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-and">operator&amp;</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-and-1">operator&amp;</a></b>(const QRect &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-and-eq">operator&amp;=</a></b>(const QRegion &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-and-eq-1">operator&amp;=</a></b>(const QRect &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-2b">operator+</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-2b-1">operator+</a></b>(const QRect &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-2b-eq">operator+=</a></b>(const QRegion &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-2b-eq-1">operator+=</a></b>(const QRect &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-">operator-</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator--eq">operator-=</a></b>(const QRegion &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-eq-eq">operator==</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-5e">operator^</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-5e-eq">operator^=</a></b>(const QRegion &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRegion </td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-7c">operator|</a></b>(const QRegion &amp;<i>r</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-7c-eq">operator|=</a></b>(const QRegion &amp;<i>r</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-lt-lt-2">operator&lt;&lt;</a></b>(QDataStream &amp;<i>s</i>, const QRegion &amp;<i>r</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qregion.html#operator-gt-gt">operator&gt;&gt;</a></b>(QDataStream &amp;<i>s</i>, QRegion &amp;<i>r</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QRegion-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>QRegion is used with <a href="qpainter.html#setClipRegion">QPainter::setClipRegion</a>() to limit the paint area to what needs to be painted. There is also a <a href="../qtwidgets/qwidget.html#repaint">QWidget::repaint</a>() function that takes a QRegion parameter. QRegion is the best tool for minimizing the amount of screen area to be updated by a repaint.</p>
<p>This class is not suitable for constructing shapes for rendering, especially as outlines. Use <a href="qpainterpath.html">QPainterPath</a> to create paths and shapes for use with <a href="qpainter.html">QPainter</a>.</p>
<p>QRegion is an <a href="../qtcore/implicit-sharing.html">implicitly shared</a> class.</p>
<a name="creating-and-using-regions"></a>
<h3 id="creating-and-using-regions">Creating and Using Regions</h3>
<p>A region can be created from a rectangle, an ellipse, a polygon or a bitmap. Complex regions may be created by combining simple regions using <a href="qregion.html#united">united</a>(), <a href="qregion.html#intersected">intersected</a>(), <a href="qregion.html#subtracted">subtracted</a>(), or <a href="qregion.html#xored">xored</a>() (exclusive or). You can move a region using <a href="qregion.html#translate">translate</a>().</p>
<p>You can test whether a region <a href="qregion.html#isEmpty">isEmpty</a>() or if it <a href="qregion.html#contains">contains</a>() a <a href="../qtcore/qpoint.html">QPoint</a> or <a href="../qtcore/qrect.html">QRect</a>. The bounding rectangle can be found with <a href="qregion.html#boundingRect">boundingRect</a>().</p>
<p>Iteration over the region (with <a href="qregion.html#begin">begin</a>(), <a href="qregion.html#end">end</a>(), or C++11 ranged-for loops) gives a decomposition of the region into rectangles.</p>
<p>Example of using complex regions:</p>
<pre class="cpp">

  <span class="type">void</span> MyWidget<span class="operator">::</span>paintEvent(<span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> <span class="operator">*</span>)
  {
      <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> r1(<span class="type"><a href="../qtcore/qrect.html">QRect</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span><span class="operator">,</span> <span class="number">200</span><span class="operator">,</span> <span class="number">80</span>)<span class="operator">,</span>    <span class="comment">// r1: elliptic region</span>
                 <span class="type"><a href="qregion.html#QRegion">QRegion</a></span><span class="operator">::</span>Ellipse);
      <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> r2(<span class="type"><a href="../qtcore/qrect.html">QRect</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">120</span><span class="operator">,</span> <span class="number">90</span><span class="operator">,</span> <span class="number">30</span>));    <span class="comment">// r2: rectangular region</span>
      <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> r3 <span class="operator">=</span> r1<span class="operator">.</span>intersected(r2);        <span class="comment">// r3: intersection</span>

      <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
      painter<span class="operator">.</span>setClipRegion(r3);
      <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>                                     <span class="comment">// paint clipped graphics</span>
  }

</pre>
</div>
<p><b>See also </b><a href="qpainter.html#setClipRegion">QPainter::setClipRegion</a>(), <a href="qpainter.html#setClipRect">QPainter::setClipRect</a>(), and <a href="qpainterpath.html">QPainterPath</a>.</p>
<!-- @@@QRegion -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$RegionType$$$Rectangle$$$Ellipse -->
<h3 class="fn" id="RegionType-enum"><a name="RegionType-enum"></a>enum QRegion::<span class="name">RegionType</span></h3>
<p>Specifies the shape of the region to be created.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QRegion::Rectangle</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">the region covers the entire rectangle.</td></tr>
<tr><td class="topAlign"><code>QRegion::Ellipse</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">the region is an ellipse inside the rectangle.</td></tr>
</table></div>
<!-- @@@RegionType -->
<!-- $$$const_iterator -->
<h3 class="fn" id="const_iterator-typedef"><a name="const_iterator-typedef"></a>typedef QRegion::<span class="name">const_iterator</span></h3>
<p>An iterator over the non-overlapping rectangles that make up the region.</p>
<p>The union of all the rectangles is equal to the original region.</p>
<p><a href="qregion.html">QRegion</a> does not offer mutable iterators.</p>
<p>This typedef was introduced in Qt 5.8.</p>
<p><b>See also </b><a href="qregion.html#begin">begin</a>() and <a href="qregion.html#end">end</a>().</p>
<!-- @@@const_iterator -->
<!-- $$$const_reverse_iterator -->
<h3 class="fn" id="const_reverse_iterator-typedef"><a name="const_reverse_iterator-typedef"></a>typedef QRegion::<span class="name">const_reverse_iterator</span></h3>
<p>A reverse iterator over the non-overlapping rectangles that make up the region.</p>
<p>The union of all the rectangles is equal to the original region.</p>
<p><a href="qregion.html">QRegion</a> does not offer mutable iterators.</p>
<p>This typedef was introduced in Qt 5.8.</p>
<p><b>See also </b><a href="qregion.html#rbegin">rbegin</a>() and <a href="qregion.html#rend">rend</a>().</p>
<!-- @@@const_reverse_iterator -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QRegion$$$QRegionconstQBitmap& -->
<h3 class="fn" id="QRegion-6"><a name="QRegion-6"></a>QRegion::<span class="name">QRegion</span>(const <span class="type"><a href="qbitmap.html">QBitmap</a></span> &amp;<i>bm</i>)</h3>
<p>Constructs a region from the bitmap <i>bm</i>.</p>
<p>The resulting region consists of the pixels in bitmap <i>bm</i> that are <a href="../qtcore/qt.html#GlobalColor-enum">Qt::color1</a>, as if each pixel was a 1 by 1 rectangle.</p>
<p>This constructor may create complex regions that will slow down painting when used. Note that drawing masked pixmaps can be done much faster using <a href="qpixmap.html#setMask">QPixmap::setMask</a>().</p>
<!-- @@@QRegion -->
<!-- $$$QRegion$$$QRegionQRegion&& -->
<h3 class="fn" id="QRegion-5"><a name="QRegion-5"></a>QRegion::<span class="name">QRegion</span>(<span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-constructs a new region from region <i>other</i>. After the call, <i>other</i> is null.</p>
<p>This function was introduced in Qt 5.7.</p>
<p><b>See also </b><a href="qregion.html#isNull">isNull</a>().</p>
<!-- @@@QRegion -->
<!-- $$$QRegion$$$QRegionconstQRegion& -->
<h3 class="fn" id="QRegion-4"><a name="QRegion-4"></a>QRegion::<span class="name">QRegion</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Constructs a new region which is equal to region <i>r</i>.</p>
<!-- @@@QRegion -->
<!-- $$$QRegion$$$QRegionconstQPolygon&Qt::FillRule -->
<h3 class="fn" id="QRegion-3"><a name="QRegion-3"></a>QRegion::<span class="name">QRegion</span>(const <span class="type"><a href="qpolygon.html">QPolygon</a></span> &amp;<i>a</i>, <span class="type"><a href="../qtcore/qt.html#FillRule-enum">Qt::FillRule</a></span> <i>fillRule</i> = Qt::OddEvenFill)</h3>
<p>Constructs a polygon region from the point array <i>a</i> with the fill rule specified by <i>fillRule</i>.</p>
<p>If <i>fillRule</i> is <a href="../qtcore/qt.html#FillRule-enum">Qt::WindingFill</a>, the polygon region is defined using the winding algorithm; if it is <a href="../qtcore/qt.html#FillRule-enum">Qt::OddEvenFill</a>, the odd-even fill algorithm is used.</p>
<p><b>Warning:</b> This constructor can be used to create complex regions that will slow down painting when used.</p>
<!-- @@@QRegion -->
<!-- $$$QRegion$$$QRegionconstQRect&QRegion::RegionType -->
<h3 class="fn" id="QRegion-2"><a name="QRegion-2"></a>QRegion::<span class="name">QRegion</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>r</i>, <span class="type"><a href="qregion.html#RegionType-enum">QRegion::RegionType</a></span> <i>t</i> = Rectangle)</h3>
<p>This is an overloaded function.</p>
<p>Create a region based on the rectange <i>r</i> with region type <i>t</i>.</p>
<p>If the rectangle is invalid a null region will be created.</p>
<p><b>See also </b><a href="qregion.html#RegionType-enum">QRegion::RegionType</a>.</p>
<!-- @@@QRegion -->
<!-- $$$QRegion$$$QRegionintintintintQRegion::RegionType -->
<h3 class="fn" id="QRegion-1"><a name="QRegion-1"></a>QRegion::<span class="name">QRegion</span>(<span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>w</i>, <span class="type">int</span> <i>h</i>, <span class="type"><a href="qregion.html#RegionType-enum">QRegion::RegionType</a></span> <i>t</i> = Rectangle)</h3>
<p>Constructs a rectangular or elliptic region.</p>
<p>If <i>t</i> is <code>Rectangle</code>, the region is the filled rectangle (<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>). If <i>t</i> is <code>Ellipse</code>, the region is the filled ellipse with center at (<i>x</i> + <i>w</i> / 2, <i>y</i> + <i>h</i> / 2) and size (<i>w</i> ,<i>h</i>).</p>
<!-- @@@QRegion -->
<!-- $$$QRegion[overload1]$$$QRegion -->
<h3 class="fn" id="QRegion"><a name="QRegion"></a>QRegion::<span class="name">QRegion</span>()</h3>
<p>Constructs an empty region.</p>
<p><b>See also </b><a href="qregion.html#isEmpty">isEmpty</a>().</p>
<!-- @@@QRegion -->
<!-- $$$operator=$$$operator=QRegion&& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator=</span>(<span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assigns <i>other</i> to this <a href="qregion.html">QRegion</a> instance.</p>
<p>This function was introduced in Qt 5.2.</p>
<!-- @@@operator= -->
<!-- $$$operator=[overload1]$$$operator=constQRegion& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator=</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Assigns <i>r</i> to this region and returns a reference to the region.</p>
<!-- @@@operator= -->
<!-- $$$begin[overload1]$$$begin -->
<h3 class="fn" id="begin"><a name="begin"></a><span class="type"><a href="qregion.html#const_iterator-typedef">QRegion::const_iterator</a></span> QRegion::<span class="name">begin</span>() const</h3>
<p>Returns a <a href="qregion.html#const_iterator-typedef">const_iterator</a> pointing to the beginning of the range of non-overlapping rectangles that make up the region.</p>
<p>The union of all the rectangles is equal to the original region.</p>
<p>This function was introduced in Qt 5.8.</p>
<p><b>See also </b><a href="qregion.html#rbegin">rbegin</a>(), <a href="qregion.html#cbegin">cbegin</a>(), and <a href="qregion.html#end">end</a>().</p>
<!-- @@@begin -->
<!-- $$$boundingRect[overload1]$$$boundingRect -->
<h3 class="fn" id="boundingRect"><a name="boundingRect"></a><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QRegion::<span class="name">boundingRect</span>() const</h3>
<p>Returns the bounding rectangle of this region. An empty region gives a rectangle that is <a href="../qtcore/qrect.html#isNull">QRect::isNull</a>().</p>
<!-- @@@boundingRect -->
<!-- $$$cbegin[overload1]$$$cbegin -->
<h3 class="fn" id="cbegin"><a name="cbegin"></a><span class="type"><a href="qregion.html#const_iterator-typedef">QRegion::const_iterator</a></span> QRegion::<span class="name">cbegin</span>() const</h3>
<p>Same as <a href="qregion.html#begin">begin</a>().</p>
<p>This function was introduced in Qt 5.8.</p>
<!-- @@@cbegin -->
<!-- $$$cend[overload1]$$$cend -->
<h3 class="fn" id="cend"><a name="cend"></a><span class="type"><a href="qregion.html#const_iterator-typedef">QRegion::const_iterator</a></span> QRegion::<span class="name">cend</span>() const</h3>
<p>Same as <a href="qregion.html#end">end</a>().</p>
<p>This function was introduced in Qt 5.8.</p>
<!-- @@@cend -->
<!-- $$$contains[overload1]$$$containsconstQPoint& -->
<h3 class="fn" id="contains"><a name="contains"></a><span class="type">bool</span> QRegion::<span class="name">contains</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>p</i>) const</h3>
<p>Returns <code>true</code> if the region contains the point <i>p</i>; otherwise returns <code>false</code>.</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsconstQRect& -->
<h3 class="fn" id="contains-1"><a name="contains-1"></a><span class="type">bool</span> QRegion::<span class="name">contains</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>r</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns <code>true</code> if the region overlaps the rectangle <i>r</i>; otherwise returns <code>false</code>.</p>
<!-- @@@contains -->
<!-- $$$crbegin[overload1]$$$crbegin -->
<h3 class="fn" id="crbegin"><a name="crbegin"></a><span class="type"><a href="qregion.html#const_reverse_iterator-typedef">QRegion::const_reverse_iterator</a></span> QRegion::<span class="name">crbegin</span>() const</h3>
<p>Same as <a href="qregion.html#rbegin">rbegin</a>().</p>
<p>This function was introduced in Qt 5.8.</p>
<!-- @@@crbegin -->
<!-- $$$crend[overload1]$$$crend -->
<h3 class="fn" id="crend"><a name="crend"></a><span class="type"><a href="qregion.html#const_reverse_iterator-typedef">QRegion::const_reverse_iterator</a></span> QRegion::<span class="name">crend</span>() const</h3>
<p>Same as <a href="qregion.html#rend">rend</a>().</p>
<p>This function was introduced in Qt 5.8.</p>
<!-- @@@crend -->
<!-- $$$end[overload1]$$$end -->
<h3 class="fn" id="end"><a name="end"></a><span class="type"><a href="qregion.html#const_iterator-typedef">QRegion::const_iterator</a></span> QRegion::<span class="name">end</span>() const</h3>
<p>Returns a <a href="qregion.html#const_iterator-typedef">const_iterator</a> pointing to one past the end of non-overlapping rectangles that make up the region.</p>
<p>The union of all the rectangles is equal to the original region.</p>
<p>This function was introduced in Qt 5.8.</p>
<p><b>See also </b><a href="qregion.html#rend">rend</a>(), <a href="qregion.html#cend">cend</a>(), and <a href="qregion.html#begin">begin</a>().</p>
<!-- @@@end -->
<!-- $$$intersected[overload1]$$$intersectedconstQRegion& -->
<h3 class="fn" id="intersected"><a name="intersected"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">intersected</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Returns a region which is the intersection of this region and <i>r</i>.</p>
<p class="centerAlign"><img src="images/rintersect.png" alt="Region Intersection" /></p><p>The figure shows the intersection of two elliptical regions.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qregion.html#subtracted">subtracted</a>(), <a href="qregion.html#united">united</a>(), and <a href="qregion.html#xored">xored</a>().</p>
<!-- @@@intersected -->
<!-- $$$intersected$$$intersectedconstQRect& -->
<h3 class="fn" id="intersected-1"><a name="intersected-1"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">intersected</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>) const</h3>
<p>Returns a region which is the intersection of this region and the given <i>rect</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qregion.html#subtracted">subtracted</a>(), <a href="qregion.html#united">united</a>(), and <a href="qregion.html#xored">xored</a>().</p>
<!-- @@@intersected -->
<!-- $$$intersects[overload1]$$$intersectsconstQRegion& -->
<h3 class="fn" id="intersects"><a name="intersects"></a><span class="type">bool</span> QRegion::<span class="name">intersects</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>region</i>) const</h3>
<p>Returns <code>true</code> if this region intersects with <i>region</i>, otherwise returns <code>false</code>.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@intersects -->
<!-- $$$intersects$$$intersectsconstQRect& -->
<h3 class="fn" id="intersects-1"><a name="intersects-1"></a><span class="type">bool</span> QRegion::<span class="name">intersects</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>) const</h3>
<p>Returns <code>true</code> if this region intersects with <i>rect</i>, otherwise returns <code>false</code>.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@intersects -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn" id="isEmpty"><a name="isEmpty"></a><span class="type">bool</span> QRegion::<span class="name">isEmpty</span>() const</h3>
<p>Returns <code>true</code> if the region is empty; otherwise returns <code>false</code>. An empty region is a region that contains no points.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> r1(<span class="number">10</span><span class="operator">,</span> <span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>);
  r1<span class="operator">.</span>isEmpty();               <span class="comment">// false</span>

  <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> r3;
  r3<span class="operator">.</span>isEmpty();               <span class="comment">// true</span>

  <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> r2(<span class="number">40</span><span class="operator">,</span> <span class="number">40</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>);
  r3 <span class="operator">=</span> r1<span class="operator">.</span>intersected(r2);    <span class="comment">// r3: intersection of r1 and r2</span>
  r3<span class="operator">.</span>isEmpty();               <span class="comment">// true</span>

  r3 <span class="operator">=</span> r1<span class="operator">.</span>united(r2);         <span class="comment">// r3: union of r1 and r2</span>
  r3<span class="operator">.</span>isEmpty();               <span class="comment">// false</span>

</pre>
<!-- @@@isEmpty -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn" id="isNull"><a name="isNull"></a><span class="type">bool</span> QRegion::<span class="name">isNull</span>() const</h3>
<p>Returns <code>true</code> if the region is empty; otherwise returns <code>false</code>. An empty region is a region that contains no points. This function is the same as <a href="qregion.html#isEmpty">isEmpty</a></p>
<p>This function was introduced in Qt 5.0.</p>
<p><b>See also </b><a href="qregion.html#isEmpty">isEmpty</a>().</p>
<!-- @@@isNull -->
<!-- $$$rbegin[overload1]$$$rbegin -->
<h3 class="fn" id="rbegin"><a name="rbegin"></a><span class="type"><a href="qregion.html#const_reverse_iterator-typedef">QRegion::const_reverse_iterator</a></span> QRegion::<span class="name">rbegin</span>() const</h3>
<p>Returns a <a href="qregion.html#const_reverse_iterator-typedef">const_reverse_iterator</a> pointing to the beginning of the range of non-overlapping rectangles that make up the region.</p>
<p>The union of all the rectangles is equal to the original region.</p>
<p>This function was introduced in Qt 5.8.</p>
<p><b>See also </b><a href="qregion.html#begin">begin</a>(), <a href="qregion.html#crbegin">crbegin</a>(), and <a href="qregion.html#rend">rend</a>().</p>
<!-- @@@rbegin -->
<!-- $$$rectCount[overload1]$$$rectCount -->
<h3 class="fn" id="rectCount"><a name="rectCount"></a><span class="type">int</span> QRegion::<span class="name">rectCount</span>() const</h3>
<p>Returns the number of rectangles that this region is composed of. Same as <code>end() - begin()</code>.</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@rectCount -->
<!-- $$$rend[overload1]$$$rend -->
<h3 class="fn" id="rend"><a name="rend"></a><span class="type"><a href="qregion.html#const_reverse_iterator-typedef">QRegion::const_reverse_iterator</a></span> QRegion::<span class="name">rend</span>() const</h3>
<p>Returns a <a href="qregion.html#const_reverse_iterator-typedef">const_reverse_iterator</a> pointing to one past the end of the range of non-overlapping rectangles that make up the region.</p>
<p>The union of all the rectangles is equal to the original region.</p>
<p>This function was introduced in Qt 5.8.</p>
<p><b>See also </b><a href="qregion.html#end">end</a>(), <a href="qregion.html#crend">crend</a>(), and <a href="qregion.html#rbegin">rbegin</a>().</p>
<!-- @@@rend -->
<!-- $$$setRects[overload1]$$$setRectsconstQRect*int -->
<h3 class="fn" id="setRects"><a name="setRects"></a><span class="type">void</span> QRegion::<span class="name">setRects</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> *<i>rects</i>, <span class="type">int</span> <i>number</i>)</h3>
<p>Sets the region using the array of rectangles specified by <i>rects</i> and <i>number</i>. The rectangles <i>must</i> be optimally Y-X sorted and follow these restrictions:</p>
<ul>
<li>The rectangles must not intersect.</li>
<li>All rectangles with a given top coordinate must have the same height.</li>
<li>No two rectangles may abut horizontally (they should be combined into a single wider rectangle in that case).</li>
<li>The rectangles must be sorted in ascending order, with Y as the major sort key and X as the minor sort key.</li>
</ul>
<p><b>See also </b><a href="qregion-obsolete.html#rects">rects</a>().</p>
<!-- @@@setRects -->
<!-- $$$subtracted[overload1]$$$subtractedconstQRegion& -->
<h3 class="fn" id="subtracted"><a name="subtracted"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">subtracted</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Returns a region which is <i>r</i> subtracted from this region.</p>
<p class="centerAlign"><img src="images/rsubtract.png" alt="Region Subtraction" /></p><p>The figure shows the result when the ellipse on the right is subtracted from the ellipse on the left (<code>left - right</code>).</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qregion.html#intersected">intersected</a>(), <a href="qregion.html#united">united</a>(), and <a href="qregion.html#xored">xored</a>().</p>
<!-- @@@subtracted -->
<!-- $$$swap[overload1]$$$swapQRegion& -->
<h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QRegion::<span class="name">swap</span>(<span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>other</i>)</h3>
<p>Swaps region <i>other</i> with this region. This operation is very fast and never fails.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@swap -->
<!-- $$$translate[overload1]$$$translateintint -->
<h3 class="fn" id="translate"><a name="translate"></a><span class="type">void</span> QRegion::<span class="name">translate</span>(<span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i>)</h3>
<p>Translates (moves) the region <i>dx</i> along the X axis and <i>dy</i> along the Y axis.</p>
<!-- @@@translate -->
<!-- $$$translate$$$translateconstQPoint& -->
<h3 class="fn" id="translate-1"><a name="translate-1"></a><span class="type">void</span> QRegion::<span class="name">translate</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>point</i>)</h3>
<p>This is an overloaded function.</p>
<p>Translates the region <i>point</i><i>.x()</i> along the x axis and <i>point</i><i>.y()</i> along the y axis, relative to the current position. Positive values move the region to the right and down.</p>
<p>Translates to the given <i>point</i>.</p>
<!-- @@@translate -->
<!-- $$$translated[overload1]$$$translatedintint -->
<h3 class="fn" id="translated"><a name="translated"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">translated</span>(<span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i>) const</h3>
<p>Returns a copy of the region that is translated <i>dx</i> along the x axis and <i>dy</i> along the y axis, relative to the current position. Positive values move the region to the right and down.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qregion.html#translate">translate</a>().</p>
<!-- @@@translated -->
<!-- $$$translated$$$translatedconstQPoint& -->
<h3 class="fn" id="translated-1"><a name="translated-1"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">translated</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>p</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns a copy of the regtion that is translated <i>p</i><i>.x()</i> along the x axis and <i>p</i><i>.y()</i> along the y axis, relative to the current position. Positive values move the rectangle to the right and down.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qregion.html#translate">translate</a>().</p>
<!-- @@@translated -->
<!-- $$$united[overload1]$$$unitedconstQRegion& -->
<h3 class="fn" id="united"><a name="united"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">united</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Returns a region which is the union of this region and <i>r</i>.</p>
<p class="centerAlign"><img src="images/runion.png" alt="Region Union" /></p><p>The figure shows the union of two elliptical regions.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qregion.html#intersected">intersected</a>(), <a href="qregion.html#subtracted">subtracted</a>(), and <a href="qregion.html#xored">xored</a>().</p>
<!-- @@@united -->
<!-- $$$united$$$unitedconstQRect& -->
<h3 class="fn" id="united-1"><a name="united-1"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">united</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>) const</h3>
<p>Returns a region which is the union of this region and the given <i>rect</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qregion.html#intersected">intersected</a>(), <a href="qregion.html#subtracted">subtracted</a>(), and <a href="qregion.html#xored">xored</a>().</p>
<!-- @@@united -->
<!-- $$$xored[overload1]$$$xoredconstQRegion& -->
<h3 class="fn" id="xored"><a name="xored"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">xored</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Returns a region which is the exclusive or (XOR) of this region and <i>r</i>.</p>
<p class="centerAlign"><img src="images/rxor.png" alt="Region XORed" /></p><p>The figure shows the exclusive or of two elliptical regions.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qregion.html#intersected">intersected</a>(), <a href="qregion.html#united">united</a>(), and <a href="qregion.html#subtracted">subtracted</a>().</p>
<!-- @@@xored -->
<!-- $$$operator QVariant[overload1]$$$operator QVariant -->
<h3 class="fn" id="operator-QVariant"><a name="operator-QVariant"></a><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QRegion::<span class="name">operator QVariant</span>() const</h3>
<p>Returns the region as a <a href="../qtcore/qvariant.html">QVariant</a></p>
<!-- @@@operator QVariant -->
<!-- $$$operator!=[overload1]$$$operator!=constQRegion& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QRegion::<span class="name">operator!=</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this region is different from the <i>other</i> region; otherwise returns <code>false</code>.</p>
<!-- @@@operator!= -->
<!-- $$$operator&[overload1]$$$operator&constQRegion& -->
<h3 class="fn" id="operator-and"><a name="operator-and"></a>const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">operator&amp;</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Applies the <a href="qregion.html#intersected">intersected</a>() function to this region and <i>r</i>. <code>r1&amp;r2</code> is equivalent to <code>r1.intersected(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#intersected">intersected</a>().</p>
<!-- @@@operator& -->
<!-- $$$operator&$$$operator&constQRect& -->
<h3 class="fn" id="operator-and-1"><a name="operator-and-1"></a>const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">operator&amp;</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>r</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@operator& -->
<!-- $$$operator&=[overload1]$$$operator&=constQRegion& -->
<h3 class="fn" id="operator-and-eq"><a name="operator-and-eq"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator&amp;=</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Applies the <a href="qregion.html#intersected">intersected</a>() function to this region and <i>r</i> and assigns the result to this region. <code>r1&amp;=r2</code> is equivalent to <code>r1</code> = r1.intersected(r2).</p>
<p><b>See also </b><a href="qregion.html#intersected">intersected</a>().</p>
<!-- @@@operator&= -->
<!-- $$$operator&=$$$operator&=constQRect& -->
<h3 class="fn" id="operator-and-eq-1"><a name="operator-and-eq-1"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator&amp;=</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>r</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@operator&= -->
<!-- $$$operator+[overload1]$$$operator+constQRegion& -->
<h3 class="fn" id="operator-2b"><a name="operator-2b"></a>const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">operator+</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Applies the <a href="qregion.html#united">united</a>() function to this region and <i>r</i>. <code>r1+r2</code> is equivalent to <code>r1.united(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#united">united</a>() and <a href="qregion.html#operator-7c">operator|</a>().</p>
<!-- @@@operator+ -->
<!-- $$$operator+$$$operator+constQRect& -->
<h3 class="fn" id="operator-2b-1"><a name="operator-2b-1"></a>const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">operator+</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>r</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@operator+ -->
<!-- $$$operator+=[overload1]$$$operator+=constQRegion& -->
<h3 class="fn" id="operator-2b-eq"><a name="operator-2b-eq"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator+=</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Applies the <a href="qregion.html#united">united</a>() function to this region and <i>r</i> and assigns the result to this region. <code>r1+=r2</code> is equivalent to <code>r1 = r1.united(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#intersected">intersected</a>().</p>
<!-- @@@operator+= -->
<!-- $$$operator+=$$$operator+=constQRect& -->
<h3 class="fn" id="operator-2b-eq-1"><a name="operator-2b-eq-1"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator+=</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>)</h3>
<p>Returns a region that is the union of this region with the specified <i>rect</i>.</p>
<p><b>See also </b><a href="qregion.html#united">united</a>().</p>
<!-- @@@operator+= -->
<!-- $$$operator-[overload1]$$$operator-constQRegion& -->
<h3 class="fn" id="operator-"><a name="operator-"></a>const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">operator-</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Applies the <a href="qregion.html#subtracted">subtracted</a>() function to this region and <i>r</i>. <code>r1-r2</code> is equivalent to <code>r1.subtracted(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#subtracted">subtracted</a>().</p>
<!-- @@@operator- -->
<!-- $$$operator-=[overload1]$$$operator-=constQRegion& -->
<h3 class="fn" id="operator--eq"><a name="operator--eq"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator-=</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Applies the <a href="qregion.html#subtracted">subtracted</a>() function to this region and <i>r</i> and assigns the result to this region. <code>r1-=r2</code> is equivalent to <code>r1 = r1.subtracted(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#subtracted">subtracted</a>().</p>
<!-- @@@operator-= -->
<!-- $$$operator==[overload1]$$$operator==constQRegion& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QRegion::<span class="name">operator==</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Returns <code>true</code> if the region is equal to <i>r</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator^[overload1]$$$operator^constQRegion& -->
<h3 class="fn" id="operator-5e"><a name="operator-5e"></a>const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">operator^</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Applies the <a href="qregion.html#xored">xored</a>() function to this region and <i>r</i>. <code>r1^r2</code> is equivalent to <code>r1.xored(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#xored">xored</a>().</p>
<!-- @@@operator^ -->
<!-- $$$operator^=[overload1]$$$operator^=constQRegion& -->
<h3 class="fn" id="operator-5e-eq"><a name="operator-5e-eq"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator^=</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Applies the <a href="qregion.html#xored">xored</a>() function to this region and <i>r</i> and assigns the result to this region. <code>r1^=r2</code> is equivalent to <code>r1 = r1.xored(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#xored">xored</a>().</p>
<!-- @@@operator^= -->
<!-- $$$operator|[overload1]$$$operator|constQRegion& -->
<h3 class="fn" id="operator-7c"><a name="operator-7c"></a>const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> QRegion::<span class="name">operator|</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>) const</h3>
<p>Applies the <a href="qregion.html#united">united</a>() function to this region and <i>r</i>. <code>r1|r2</code> is equivalent to <code>r1.united(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#united">united</a>() and <a href="qregion.html#operator-2b">operator+</a>().</p>
<!-- @@@operator| -->
<!-- $$$operator|=[overload1]$$$operator|=constQRegion& -->
<h3 class="fn" id="operator-7c-eq"><a name="operator-7c-eq"></a><span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;QRegion::<span class="name">operator|=</span>(const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Applies the <a href="qregion.html#united">united</a>() function to this region and <i>r</i> and assigns the result to this region. <code>r1|=r2</code> is equivalent to <code>r1 = r1.united(r2)</code>.</p>
<p><b>See also </b><a href="qregion.html#united">united</a>().</p>
<!-- @@@operator|= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<$$$operator<<QDataStream&constQRegion& -->
<h3 class="fn" id="operator-lt-lt-2"><a name="operator-lt-lt-2"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&lt;&lt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>s</i>, const <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Writes the region <i>r</i> to the stream <i>s</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Format of the QDataStream operators</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>[overload1]$$$operator>>QDataStream&QRegion& -->
<h3 class="fn" id="operator-gt-gt"><a name="operator-gt-gt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&gt;&gt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>s</i>, <span class="type"><a href="qregion.html#QRegion">QRegion</a></span> &amp;<i>r</i>)</h3>
<p>Reads a region from the stream <i>s</i> into <i>r</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Format of the QDataStream operators</a>.</p>
<!-- @@@operator>> -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
